<template>
  <div id="top-header">
    <Decoration8 class="header-left-decoration" />
    <Decoration5 class="header-center-decoration" />
    <Decoration8 class="header-right-decoration" :reverse="true" />
    <div class="center-title">LOCN DASHBOARD</div>
    <div class="center-title2">{{ currentTime }}</div>
  </div>
</template>

<script setup>
import { Decoration8, Decoration5 } from "@kjgl77/datav-vue3";
import { ref, onMounted, onUnmounted } from "vue";
import moment from "moment";
const currentTime = ref(moment(new Date()).format("YYYY-MM-DD HH:mm:ss"));
const updateTime = () => {
  currentTime.value = moment(new Date()).format("YYYY-MM-DD HH:mm:ss");
};
const timer = setInterval(updateTime, 1000);
onUnmounted(() => {
  clearInterval(timer);
});
</script>

<style scoped lang="less">
#top-header {
  position: relative;
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;

  .header-center-decoration {
    width: 40%;
    height: 60px;
    margin-top: 30px;
  }

  .header-left-decoration,
  .header-right-decoration {
    width: 25%;
    height: 60px;
  }

  .center-title {
    position: absolute;
    font-size: 35px;
    font-weight: bold;
    left: 50%;
    top: 15px;
    color: #67e0e3;
    transform: translateX(-50%);
  }
  .center-title2 {
    position: absolute;
    font-size: 20px;
    font-weight: bold;
    right: 1%;
    top: 70px;
    transform: translateX(-50%);
  }
}
</style>
